<template>
  <div class="echarts">
    <el-breadcrumb separator="/" class="mianbao">
      <el-breadcrumb-item :to="{ path: '/index' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>产品管理</el-breadcrumb-item>
      <el-breadcrumb-item>筛选列表</el-breadcrumb-item>
    </el-breadcrumb>
    <div class="big">
      <div id="main"></div>
      <div id="main2"></div>
    </div>
  </div>
</template>

<script setup>
//导入
import * as echarts from "echarts";
import { onMounted } from "vue";
//初始化echarts实例
onMounted(() => {
  var myChart = echarts.init(document.getElementById("main"));
  var myChart2 = echarts.init(document.getElementById("main2"));
  myChart.setOption({
    title: {
      text: "商品列表",
      left: "left",
    },
    tooltip: {},
    legend: {
      data: ["销量"],
      top: 10,
    },
    xAxis: {
      data: [
        "衬衫",
        "羊毛衫",
        "雪纺衫",
        "裤子",
        "高跟鞋",
        "袜子",
        "棉袄",
        "手套",
      ],
    },
    yAxis: {},
    series: [
      {
        name: "销量",
        type: "bar",
        data: [5, 20, 36, 60, 66, 10, 10, 20],
        showBackground: true,
        backgroundStyle: {
          borderRadius: 10,
        },
        barWidth: "30",
      },
    ],
  });

  myChart2.setOption({
    title: {
      text: "商品列表",
      left: "left",
    },
    tooltip: {},
    legend: {
      data: ["销量"],
      top: 10,
    },
    xAxis: {
      data: [
        "衬衫",
        "羊毛衫",
        "雪纺衫",
        "裤子",
        "高跟鞋",
        "袜子",
        "棉袄",
        "手套",
      ],
    },
    yAxis: {},
    series: [
      {
        name: "销量",
        type: "line",
        data: [5, 20, 36, 60, 66, 10, 10, 20],
        showBackground: true,
       
      },
    ],
  });
});
</script>

<style scoped lang='scss'>
#main {
  width: 49%;
  height: 300px;
}
.mianbao {
  margin-bottom: 30px;
}
.big {
  display: flex;
  flex-wrap: wrap;
  #main {
  width: 49%;
  height: 300px;
}
 #main2 {
  width: 49%;
  height: 300px;
}
}
</style>
